package com.lemon.funplus.ulti;

import android.content.Context;

import com.lemon.funplus.AccountLoginActivity;
import com.lemon.funplus.object.AccountObject;

public class AppUtils {
	
	public static void SaveAccount(Context context,AccountObject accountObject){
		PreferenceUtils.putString(context, TagName.user_avatar, accountObject.getavatar());
		PreferenceUtils.putString(context, TagName.user_name, accountObject.getname());
		PreferenceUtils.putString(context, TagName.user_birthday, accountObject.getbirthday());
		PreferenceUtils.putString(context, TagName.user_email, accountObject.getemail());
		PreferenceUtils.putString(context, TagName.user_firstname, accountObject.getfirst_name());
		PreferenceUtils.putString(context, TagName.user_gender, accountObject.getgender());
		PreferenceUtils.putString(context, TagName.user_id, accountObject.getid());
		PreferenceUtils.putString(context, TagName.user_phone, accountObject.getphone());
	}
	
	public static AccountObject getAccount(Context context){
		AccountObject accountObject=new AccountObject();
		accountObject.setavatar(PreferenceUtils.getString(context, TagName.user_avatar));
		accountObject.setname(PreferenceUtils.getString(context, TagName.user_name));
		accountObject.setbirthday(PreferenceUtils.getString(context, TagName.user_birthday));
		accountObject.setemail(PreferenceUtils.getString(context, TagName.user_email));
		accountObject.setfirst_name(PreferenceUtils.getString(context, TagName.user_firstname));
		accountObject.setgender(PreferenceUtils.getString(context, TagName.user_gender));
		accountObject.setid(PreferenceUtils.getString(context, TagName.user_id));
		accountObject.setphone(PreferenceUtils.getString(context, TagName.user_phone));
		return accountObject;
	}
}
